<?php

$title = 'Editar Datos del Usuario';
$this->headTitle($title);
?>
<h1><?php echo $this->escapeHtml($title); ?></h1><br>
<?php
$form = $this->form;
$form->setAttribute('action', $this->url(
   'usuarios',
   array('action' => 'editar',
         'id'     => $this->id,
   )
));
$form->prepare();
?>

<?php
echo $this->form()->openTag($form);
echo $this->formHidden($form->get('id'));
//echo $this->formHidden($form->get('matricula'));
//echo $this->formHidden($form->get('id_profesor'));
//echo $this->formHidden($form->get('id_funcionario'));
?>

<table class="table">
<tr>
   <td>Nombre</td>
   <td><?php echo $this->formRow($form->get('nombre'));?></td>
   <td>Apellido</td>
   <td><?php echo $this->formRow($form->get('apellido'));?></td>
</tr>
<tr>
   <td>Domicilio</td>
   <td><?php echo $this->formRow($form->get('domicilio'));?></td>
   <td>Telefono</td>
   <td><?php echo $this->formRow($form->get('telefono'));?></td>
</tr>
<tr>
   <td>Sexo</td>
   <td><?php echo $this->formRow($form->get('sexo'));?></td>
   <td>Estado Civil</td>
   <td><?php echo $this->formRow($form->get('estado_civil'));?></td>
</tr>
<tr>
   <td>Fecha Nacimiento<br>&nbsp;<i>(aaaa-mm-dd)</i></td>
   <td><?php echo $this->formRow($form->get('fecha_nacimiento'));?></td>
   <td>Lugar Nacimiento</td>
   <td><?php echo $this->formRow($form->get('lugar_nacimiento'));?></td>
</tr>
<tr>
   <td>User Name</td>
   <td><?php echo $this->formRow($form->get('username'));?></td>
   <td>E-mail</td>
   <td><?php echo $this->formRow($form->get('mail'));?></td>
</tr>
<tr>
   <td>Contraseña</td>
   <?php $form->get('password')->setValue(''); ?>
   <td><?php echo $this->formRow($form->get('password'));?></td>
   <td>Confirmar Contraseña</td>
   <?php $form->get('password_confirm')->setValue(''); ?>
   <td><?php echo $this->formRow($form->get('password_confirm'));?></td>
</tr>
<tr>
   <td>Nacionalidad</td>
   <td><?php echo $this->formRow($form->get('nacionalidad'));?></td>
   <td>Tipo de Usuario</td>
   <td>
   <table class="table" border="3">
   <tr>
      <?php
         if (!is_null($usuario->matricula)) $form->get('alumno')->setChecked(true);
         if (!is_null($usuario->id_profesor)) $form->get('profesor')->setChecked(true);
         if (!is_null($usuario->id_funcionario)) $form->get('funcionario')->setChecked(true);
      ?>
      <td><?php echo $this->formRow($form->get('alumno'));?></td> &nbsp;
      <td><?php echo $this->formRow($form->get('profesor'));?></td> &nbsp;
      <td><?php echo $this->formRow($form->get('funcionario'));?></td> &nbsp;
   </tr>
   </table>
   </td>
</tr>
<tr>
   <td><a href="/usuarios"><- atras</a></td><td></td><td></td>
   <td><?php echo $this->formSubmit($form->get('submit'));?></td>
</tr>
</table>

<?php
echo $this->form()->closeTag();
?>
